$(function(){
    $('.js-add-cart').on('click', function () {
        $(document).trigger('addCart', [$(this).data('id')]);
    });

    $('.js-cart-del').on('click', function() {
        var $this = $(this);
        $(document).trigger('delCart', [$this.data('id'), function () {
            $this.parents('.cart-li').remove();
        }]);
    });
});